package cn.tedu.lianxi1;

public class Text3 {
    public static void main(String[] args) {
        a a1=new a();
        a a2=new a();
        a a3=new a();
        a a4=new a();

        a1.start();
        a2.start();
        a3.start();
        a4.start();


    }
}
class a extends Thread {
   static int b=100;

   synchronized public  void run() {
        while(true){

                if (b>0){
                    try {
                        Thread.sleep(10);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    System.out.println(Thread.currentThread().getName()+"---"+b--);
                }else{
                    break;
                }

        }
    }
}
